/*
<Copyright (C) 2011 Dru Moore>

This file is part of demorecorder.

vlc-remote is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

demorecorder is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with demorecorder.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SIMPLETRACK_H
#define SIMPLETRACK_H

#include <QObject>
#include <QString>
#include <gst/gst.h>

class SimpleTrack : public QObject
{
    Q_OBJECT
public:
    explicit SimpleTrack(QObject *parent = 0);
    SimpleTrack(QObject *parent = 0, QString name = "", QString file = "", long long start = 0, long long duration = -1, long long mediaStart = 0, long long mediaDuration = -1);
    GstElement* getTrackBin();
    long long getDuration();

signals:

public slots:
    void setFileSrc(QString path);
    void setValues(long long start = 0, long long duration = -1, long long mediaStart = 0, long long mediaDuration = -1);
    static gboolean pad_added(GstElement* pipeline, GstPad* srcPad, GstElement* sink);
    QString getName();
    QString getFilePath();
    QString getFileUri();
    void setMute(bool mute);
    void setVolume(double volume);
    void setPanorama(double panorama);

private:
    GstPipeline *pipeline;
    GstElement *composition;
    GstElement *file_src;
    GstElement *silence;
    GstElement *volume;
    GstElement *level;
    GstElement *panorama;
    GstElement *converter;
    GstElement *bin;
    void create_bin();
    QString name;
    QString file_path;
    QString file_uri;
    long long start;
    long long duration;
    long long mediaStart;
    long long mediaDuration;
    bool valid;

};

#endif // SIMPLETRACK_H
